import { BTNode } from "../BTNode";
import { BTState } from "../BTState";

/**
 * [行为树]行为节点
 */
export class BTAction<T = any> extends BTNode<T>{

    constructor(
        public action: (ctx: T) => BTState
    ) {
        super();
    }

    process(ctx: T): BTState {
        return this.action(ctx);
    }

}